/** */
var PM = PM || {};

PM.More = {};
PM.More.Initialize = function(config)
{
	config = config || {};

	PM.More._url = config.url;
	PM.More._query = config.query || {};
	PM.More._gridview = $(config.gridview);
	
	PM.More._query.size = config.size || 10;
	PM.More._query._index = config.index || 0;
	
	$(window).scroll(function(){
		var scrollTop = $(this).scrollTop(),
			scrollHeight = $(document).height(),
			windowHeight = $(this).height();
	
		if(scrollTop + windowHeight == scrollHeight){
			PM.More._Load();
		}
	});
};

PM.More._Load = function()
{
	PM.More._query._index++;
	alert(JSON.stringify(PM.More._query));
	jQuery.ajax(
	{
		url: PM.More._url,
		type: 'GET',
		dataType: 'HTML',
		data: PM.More._query,
		success: function(result)
		{
			PM.More._gridview.append(result);
			alert(result);
		}
	});
};

/** 放回顶部功能js*/
PM.ScrollToTop = PM.ScrollToTop || {};
PM.ScrollToTop.Initialize = function(){
	PM.ScrollToTop.setup();
};
PM.ScrollToTop.setup = function(){
		
	var a=$(window).height()/2;
	
	$(window).scroll(function(){
		(window.innerWidth?window.pageYOffset:document.documentElement.scrollTop)<a?$(".backTop").removeClass("backTopBtnShow"):$(".backTop").addClass("backTopBtnShow")
	});
	$(".backTop").click(function(){
		$("html, body").animate({scrollTop:"0px"},400);
		return false
	})
}



